<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/jquery-3.4.1.js"></script>
	</head>
	<body>
		<input type="text" name="username" value="123456"/>
		<script>
			//获取name的值
			var ele = document.getElementsByTagName("input")[0];
			var jq = $(":text").eq(0);
			
			console.log(ele.name);	
			console.log(ele.getAttribute("name"));
			console.log($(":text").attr("name"));
			//改变type
			ele.type = "password";
			ele.setAttribute("type","text");
			//jq.attr("type","checkbox");
			jq.attr("disabled","");
			
			//移除属性
			//ele.removeAttribute("name");
			//ele.name="";
			jq.removeAttr("name");
			console.log(ele.name);
			
			//ele.removeAttribute("disabled");
			jq.removeAttr("disabled");
			console.log(jq.attr("disabled"));
			
		</script>
	</body>
</html>
